package com.chebaohui.iqs.service.impl.deal.bihu.num;

import com.alibaba.druid.support.logging.Log;
import com.alibaba.druid.support.logging.LogFactory;
import com.alibaba.fastjson.JSONObject;
import com.chebaohui.iqs.config.BiHuConfig;
import com.chebaohui.iqs.service.impl.deal.bihu.entity.req.ReqCommon;
import com.chebaohui.iqs.service.impl.deal.bihu.utils.BHHttpClientUtil;
import com.chebaohui.iqs.service.impl.deal.bihu.utils.GetUrlUtil;

public class SixteenInterface {
	/**
	 * log:日志输出
	 */
	private static Log log = LogFactory.getLog(SixteenInterface.class);
    /**
     * 壁虎16号接口 获取重复投保详细信息
     * @param obj 传入一个javabean
     * @return json格式数据
     * @throws Exception 
     */
	public JSONObject sixteen(ReqCommon obj){
		log.info("\n"+"进入壁虎第16号接口。。。。。"
				+"\n"+"开始根据信息重复投保详细信息");
		JSONObject result = null;
		try {
			String newurl = GetUrlUtil.getUrl(obj, BiHuConfig.SixteenUrl );
			String org=BHHttpClientUtil._httpGetToBody(newurl);
			log.info("\n"+"车辆查询：车牌号==>"+obj.getLicenseNo()
			+"\n"+"请求路径"+newurl
			+"\n"+"请求参数："+JSONObject.toJSONString(obj)
			+"\n"+"返回结果："+org
			+"\n"+"结束壁虎第16号接口。。。。");	
			result=JSONObject.parseObject(org);
			return result;
		} catch (Exception e) {
			log.error("\n"+"壁虎6号接口错误:"+e.getMessage());
		}
		return result;
	}
	
}
